using System;
using System.Text;

namespace BTEditor
{
    [BTDecorator]
    public class Root : Decorator
    {
        public override Type GetNodeType()
        {
            return typeof(NPBehave.Root);
        }

        public override EditorNodeEnum NodeEnum
        {
            get { return EditorNodeEnum.Root; }
        }

        public override ErrorType GetIsVaild()
        {
            return BelongNode.DefaultNode != null ? ErrorType.None : ErrorType.Error;
        }

        public override string ToChild()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append($"new {BTUtils.GetTypeName(GetNodeType().FullName)}");
            sb.Append($"( \n");
            sb.Append($"{BelongNode.DefaultNode?.ToChild()} \n");
            sb.Append($"); \n");
            return sb.ToString();
        }

    }
}